package com.ych.modules.api.unAuthorInfc.job.controller;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
import com.ych.modules.api.authorInfc.job.entity.AddJobEntity;
import com.ych.modules.api.authorInfc.job.entity.AuditReceiveJobEntity;
import com.ych.modules.api.authorInfc.job.entity.ReceiveJobEntity;
import com.ych.modules.api.authorInfc.job.entity.SubmitReceiveJobEntity;
import com.ych.modules.base.dbEntity.TJobReceiveEntity;
import com.ych.modules.base.dbEntity.TUserJobEntity;
import com.ych.modules.common.entity.query.QueryReceiveJobEntity;
import com.ych.modules.common.entity.query.QueryUserJobEntity;
import com.ych.modules.common.service.UserJobService;
import com.ych.utils.TLMap;
import com.ych.utils.mysqlPageUtil.PageUtils;
import com.ych.utils.serviceReturn.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Author: Usopp.tsui
 * Date: 2021/3/8
 * Time: 17:21
 * Description:
 */
@RestController("apiUnAuthUserJobController")
@RequestMapping("/api/unAuth/job")
@Api(tags = {"API——不授权接口，用户任务相关"}, description = "API——不授权接口，用户任务相关")
public class UserJobController {
    @Autowired
    private UserJobService userJobService;

    @PostMapping("/listUserJob")
    @ApiOperation(value = "任务列表查询", notes = "任务列表查询")
    public R<Page<TUserJobEntity>> listUserJob(@RequestBody QueryUserJobEntity entity) {
        try {
            Page<TUserJobEntity> page = userJobService.listUserJob(entity);
            return new R(0, "成功", new PageUtils(page));
        } catch (Exception e) {
            return new R(1, e.getMessage(), null);
        }
    }
}
